/**
 * 自适应图片尺寸映射 - 由自适应图片处理工具自动生成
 * 生成时间: 2025/5/14 01:14:34
 */

let imageData = null; // 缓存加载后的数据
let isLoading = false;
let loadPromise = null;

// 注意：此路径是相对于 utils 目录，因为 image_size_map.js 在 utils 目录下
// 如果 image_size_map_data.json 也在 utils 目录下，路径应为 './image_size_map_data.json'
// 如果最终 image_size_map_data.json 放在项目根目录或其他地方，需要相应调整
const DATA_PATH = './image_size_map_data.json'; 

function _internalEnsureDataLoaded() {
  if (imageData) {
    return Promise.resolve(imageData);
  }
  if (isLoading && loadPromise) {
    return loadPromise;
  }

  isLoading = true;
  loadPromise = new Promise((resolve, reject) => {
    wx.getFileSystemManager().readFile({
      filePath: DATA_PATH,
      encoding: 'utf8',
      success: (res) => {
        try {
          imageData = JSON.parse(res.data);
          isLoading = false;
          console.log('[image_size_map] Image map data loaded successfully.');
          resolve(imageData);
        } catch (e) {
          console.error('[image_size_map] Failed to parse image_size_map_data.json', e);
          imageData = {}; // 即使解析失败，也给一个空对象，避免后续访问imageData时出错
          isLoading = false;
          reject(e); // 或者 resolve({}) 让调用方自行处理空数据
        }
      },
      fail: (err) => {
        console.error('[image_size_map] Failed to read image_size_map_data.json', err);
        imageData = {}; // 读取失败，也给一个空对象
        isLoading = false;
        reject(err); // 或者 resolve({})
      }
    });
  });
  return loadPromise;
}

// 模块加载时开始预加载数据
// 如果此模块在 app.js 启动阶段就被同步 require，那么这里的异步操作不会阻塞 app.js
// 但如果 getAdaptiveImagePath 很快被调用，数据可能尚未就绪
_internalEnsureDataLoaded().catch(err => {
  console.warn('[image_size_map] Preloading image map data failed. getAdaptiveImagePath will return original paths until data is ready.');
});

module.exports = {
  // 图片尺寸映射
  imageSizeMap: {
  "images\\001.png": {
    "original": "images\\001.png",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\images\\001.png",
        "relativePath": "images/adaptive/small/images/001.png"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\images\\001.png",
        "relativePath": "images/adaptive/medium/images/001.png"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\images\\001.png",
        "relativePath": "images/adaptive/large/images/001.png"
      }
    ]
  },
  "images\\001.webp": {
    "original": "images\\001.webp",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\images\\001.webp",
        "relativePath": "images/adaptive/small/images/001.webp"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\images\\001.webp",
        "relativePath": "images/adaptive/medium/images/001.webp"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\images\\001.webp",
        "relativePath": "images/adaptive/large/images/001.webp"
      }
    ]
  },
  "images\\006.jpg": {
    "original": "images\\006.jpg",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\images\\006.jpg",
        "relativePath": "images/adaptive/small/images/006.jpg"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\images\\006.jpg",
        "relativePath": "images/adaptive/medium/images/006.jpg"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\images\\006.jpg",
        "relativePath": "images/adaptive/large/images/006.jpg"
      }
    ]
  },
  "images\\006.webp": {
    "original": "images\\006.webp",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\images\\006.webp",
        "relativePath": "images/adaptive/small/images/006.webp"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\images\\006.webp",
        "relativePath": "images/adaptive/medium/images/006.webp"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\images\\006.webp",
        "relativePath": "images/adaptive/large/images/006.webp"
      }
    ]
  },
  "images\\010.webp": {
    "original": "images\\010.webp",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\images\\010.webp",
        "relativePath": "images/adaptive/small/images/010.webp"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\images\\010.webp",
        "relativePath": "images/adaptive/medium/images/010.webp"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\images\\010.webp",
        "relativePath": "images/adaptive/large/images/010.webp"
      }
    ]
  },
  "images\\011.webp": {
    "original": "images\\011.webp",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\images\\011.webp",
        "relativePath": "images/adaptive/small/images/011.webp"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\images\\011.webp",
        "relativePath": "images/adaptive/medium/images/011.webp"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\images\\011.webp",
        "relativePath": "images/adaptive/large/images/011.webp"
      }
    ]
  },
  "images\\012.webp": {
    "original": "images\\012.webp",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\images\\012.webp",
        "relativePath": "images/adaptive/small/images/012.webp"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\images\\012.webp",
        "relativePath": "images/adaptive/medium/images/012.webp"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\images\\012.webp",
        "relativePath": "images/adaptive/large/images/012.webp"
      }
    ]
  },
  "images\\013.webp": {
    "original": "images\\013.webp",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\images\\013.webp",
        "relativePath": "images/adaptive/small/images/013.webp"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\images\\013.webp",
        "relativePath": "images/adaptive/medium/images/013.webp"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\images\\013.webp",
        "relativePath": "images/adaptive/large/images/013.webp"
      }
    ]
  },
  "images\\014.webp": {
    "original": "images\\014.webp",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\images\\014.webp",
        "relativePath": "images/adaptive/small/images/014.webp"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\images\\014.webp",
        "relativePath": "images/adaptive/medium/images/014.webp"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\images\\014.webp",
        "relativePath": "images/adaptive/large/images/014.webp"
      }
    ]
  },
  "images\\015.webp": {
    "original": "images\\015.webp",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\images\\015.webp",
        "relativePath": "images/adaptive/small/images/015.webp"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\images\\015.webp",
        "relativePath": "images/adaptive/medium/images/015.webp"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\images\\015.webp",
        "relativePath": "images/adaptive/large/images/015.webp"
      }
    ]
  },
  "images\\016.webp": {
    "original": "images\\016.webp",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\images\\016.webp",
        "relativePath": "images/adaptive/small/images/016.webp"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\images\\016.webp",
        "relativePath": "images/adaptive/medium/images/016.webp"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\images\\016.webp",
        "relativePath": "images/adaptive/large/images/016.webp"
      }
    ]
  },
  "src\\device_types\\seawater_lamp\\images\\002.png": {
    "original": "src\\device_types\\seawater_lamp\\images\\002.png",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\src\\device_types\\seawater_lamp\\images\\002.png",
        "relativePath": "images/adaptive/small/src/device_types/seawater_lamp/images/002.png"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\src\\device_types\\seawater_lamp\\images\\002.png",
        "relativePath": "images/adaptive/medium/src/device_types/seawater_lamp/images/002.png"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\src\\device_types\\seawater_lamp\\images\\002.png",
        "relativePath": "images/adaptive/large/src/device_types/seawater_lamp/images/002.png"
      }
    ]
  },
  "src\\device_types\\seawater_lamp\\images\\002.webp": {
    "original": "src\\device_types\\seawater_lamp\\images\\002.webp",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\src\\device_types\\seawater_lamp\\images\\002.webp",
        "relativePath": "images/adaptive/small/src/device_types/seawater_lamp/images/002.webp"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\src\\device_types\\seawater_lamp\\images\\002.webp",
        "relativePath": "images/adaptive/medium/src/device_types/seawater_lamp/images/002.webp"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\src\\device_types\\seawater_lamp\\images\\002.webp",
        "relativePath": "images/adaptive/large/src/device_types/seawater_lamp/images/002.webp"
      }
    ]
  },
  "src\\device_types\\seawater_lamp\\images\\lps.webp": {
    "original": "src\\device_types\\seawater_lamp\\images\\lps.webp",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\src\\device_types\\seawater_lamp\\images\\lps.webp",
        "relativePath": "images/adaptive/small/src/device_types/seawater_lamp/images/lps.webp"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\src\\device_types\\seawater_lamp\\images\\lps.webp",
        "relativePath": "images/adaptive/medium/src/device_types/seawater_lamp/images/lps.webp"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\src\\device_types\\seawater_lamp\\images\\lps.webp",
        "relativePath": "images/adaptive/large/src/device_types/seawater_lamp/images/lps.webp"
      }
    ]
  },
  "src\\device_types\\seawater_lamp\\images\\slps.webp": {
    "original": "src\\device_types\\seawater_lamp\\images\\slps.webp",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\src\\device_types\\seawater_lamp\\images\\slps.webp",
        "relativePath": "images/adaptive/small/src/device_types/seawater_lamp/images/slps.webp"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\src\\device_types\\seawater_lamp\\images\\slps.webp",
        "relativePath": "images/adaptive/medium/src/device_types/seawater_lamp/images/slps.webp"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\src\\device_types\\seawater_lamp\\images\\slps.webp",
        "relativePath": "images/adaptive/large/src/device_types/seawater_lamp/images/slps.webp"
      }
    ]
  },
  "src\\device_types\\seawater_lamp\\images\\sps.webp": {
    "original": "src\\device_types\\seawater_lamp\\images\\sps.webp",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\src\\device_types\\seawater_lamp\\images\\sps.webp",
        "relativePath": "images/adaptive/small/src/device_types/seawater_lamp/images/sps.webp"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\src\\device_types\\seawater_lamp\\images\\sps.webp",
        "relativePath": "images/adaptive/medium/src/device_types/seawater_lamp/images/sps.webp"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\src\\device_types\\seawater_lamp\\images\\sps.webp",
        "relativePath": "images/adaptive/large/src/device_types/seawater_lamp/images/sps.webp"
      }
    ]
  },
  "src\\device_types\\freshwater_lamp\\images\\002.png": {
    "original": "src\\device_types\\freshwater_lamp\\images\\002.png",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\src\\device_types\\freshwater_lamp\\images\\002.png",
        "relativePath": "images/adaptive/small/src/device_types/freshwater_lamp/images/002.png"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\src\\device_types\\freshwater_lamp\\images\\002.png",
        "relativePath": "images/adaptive/medium/src/device_types/freshwater_lamp/images/002.png"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\src\\device_types\\freshwater_lamp\\images\\002.png",
        "relativePath": "images/adaptive/large/src/device_types/freshwater_lamp/images/002.png"
      }
    ]
  },
  "src\\device_types\\freshwater_lamp\\images\\002.webp": {
    "original": "src\\device_types\\freshwater_lamp\\images\\002.webp",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\src\\device_types\\freshwater_lamp\\images\\002.webp",
        "relativePath": "images/adaptive/small/src/device_types/freshwater_lamp/images/002.webp"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\src\\device_types\\freshwater_lamp\\images\\002.webp",
        "relativePath": "images/adaptive/medium/src/device_types/freshwater_lamp/images/002.webp"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\src\\device_types\\freshwater_lamp\\images\\002.webp",
        "relativePath": "images/adaptive/large/src/device_types/freshwater_lamp/images/002.webp"
      }
    ]
  },
  "src\\device_types\\freshwater_lamp\\images\\006.jpg": {
    "original": "src\\device_types\\freshwater_lamp\\images\\006.jpg",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\src\\device_types\\freshwater_lamp\\images\\006.jpg",
        "relativePath": "images/adaptive/small/src/device_types/freshwater_lamp/images/006.jpg"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\src\\device_types\\freshwater_lamp\\images\\006.jpg",
        "relativePath": "images/adaptive/medium/src/device_types/freshwater_lamp/images/006.jpg"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\src\\device_types\\freshwater_lamp\\images\\006.jpg",
        "relativePath": "images/adaptive/large/src/device_types/freshwater_lamp/images/006.jpg"
      }
    ]
  },
  "src\\device_types\\freshwater_lamp\\images\\006.webp": {
    "original": "src\\device_types\\freshwater_lamp\\images\\006.webp",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\src\\device_types\\freshwater_lamp\\images\\006.webp",
        "relativePath": "images/adaptive/small/src/device_types/freshwater_lamp/images/006.webp"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\src\\device_types\\freshwater_lamp\\images\\006.webp",
        "relativePath": "images/adaptive/medium/src/device_types/freshwater_lamp/images/006.webp"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\src\\device_types\\freshwater_lamp\\images\\006.webp",
        "relativePath": "images/adaptive/large/src/device_types/freshwater_lamp/images/006.webp"
      }
    ]
  },
  "src\\device_types\\freshwater_lamp\\images\\007.png": {
    "original": "src\\device_types\\freshwater_lamp\\images\\007.png",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\src\\device_types\\freshwater_lamp\\images\\007.png",
        "relativePath": "images/adaptive/small/src/device_types/freshwater_lamp/images/007.png"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\src\\device_types\\freshwater_lamp\\images\\007.png",
        "relativePath": "images/adaptive/medium/src/device_types/freshwater_lamp/images/007.png"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\src\\device_types\\freshwater_lamp\\images\\007.png",
        "relativePath": "images/adaptive/large/src/device_types/freshwater_lamp/images/007.png"
      }
    ]
  },
  "src\\device_types\\freshwater_lamp\\images\\008.png": {
    "original": "src\\device_types\\freshwater_lamp\\images\\008.png",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\src\\device_types\\freshwater_lamp\\images\\008.png",
        "relativePath": "images/adaptive/small/src/device_types/freshwater_lamp/images/008.png"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\src\\device_types\\freshwater_lamp\\images\\008.png",
        "relativePath": "images/adaptive/medium/src/device_types/freshwater_lamp/images/008.png"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\src\\device_types\\freshwater_lamp\\images\\008.png",
        "relativePath": "images/adaptive/large/src/device_types/freshwater_lamp/images/008.png"
      }
    ]
  },
  "src\\device_types\\freshwater_lamp\\images\\009.png": {
    "original": "src\\device_types\\freshwater_lamp\\images\\009.png",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\src\\device_types\\freshwater_lamp\\images\\009.png",
        "relativePath": "images/adaptive/small/src/device_types/freshwater_lamp/images/009.png"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\src\\device_types\\freshwater_lamp\\images\\009.png",
        "relativePath": "images/adaptive/medium/src/device_types/freshwater_lamp/images/009.png"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\src\\device_types\\freshwater_lamp\\images\\009.png",
        "relativePath": "images/adaptive/large/src/device_types/freshwater_lamp/images/009.png"
      }
    ]
  },
  "src\\device_types\\freshwater_lamp\\images\\4450730bcd274985a2c4d45b9c3c86f8_mergeImage.png": {
    "original": "src\\device_types\\freshwater_lamp\\images\\4450730bcd274985a2c4d45b9c3c86f8_mergeImage.png",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\src\\device_types\\freshwater_lamp\\images\\4450730bcd274985a2c4d45b9c3c86f8_mergeImage.png",
        "relativePath": "images/adaptive/small/src/device_types/freshwater_lamp/images/4450730bcd274985a2c4d45b9c3c86f8_mergeImage.png"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\src\\device_types\\freshwater_lamp\\images\\4450730bcd274985a2c4d45b9c3c86f8_mergeImage.png",
        "relativePath": "images/adaptive/medium/src/device_types/freshwater_lamp/images/4450730bcd274985a2c4d45b9c3c86f8_mergeImage.png"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\src\\device_types\\freshwater_lamp\\images\\4450730bcd274985a2c4d45b9c3c86f8_mergeImage.png",
        "relativePath": "images/adaptive/large/src/device_types/freshwater_lamp/images/4450730bcd274985a2c4d45b9c3c86f8_mergeImage.png"
      }
    ]
  },
  "src\\device_types\\freshwater_lamp\\images\\7ba3239d532542528c4f27233287cc32_mergeImage.png": {
    "original": "src\\device_types\\freshwater_lamp\\images\\7ba3239d532542528c4f27233287cc32_mergeImage.png",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\src\\device_types\\freshwater_lamp\\images\\7ba3239d532542528c4f27233287cc32_mergeImage.png",
        "relativePath": "images/adaptive/small/src/device_types/freshwater_lamp/images/7ba3239d532542528c4f27233287cc32_mergeImage.png"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\src\\device_types\\freshwater_lamp\\images\\7ba3239d532542528c4f27233287cc32_mergeImage.png",
        "relativePath": "images/adaptive/medium/src/device_types/freshwater_lamp/images/7ba3239d532542528c4f27233287cc32_mergeImage.png"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\src\\device_types\\freshwater_lamp\\images\\7ba3239d532542528c4f27233287cc32_mergeImage.png",
        "relativePath": "images/adaptive/large/src/device_types/freshwater_lamp/images/7ba3239d532542528c4f27233287cc32_mergeImage.png"
      }
    ]
  },
  "src\\device_types\\freshwater_lamp\\images\\lps.png": {
    "original": "src\\device_types\\freshwater_lamp\\images\\lps.png",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\src\\device_types\\freshwater_lamp\\images\\lps.png",
        "relativePath": "images/adaptive/small/src/device_types/freshwater_lamp/images/lps.png"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\src\\device_types\\freshwater_lamp\\images\\lps.png",
        "relativePath": "images/adaptive/medium/src/device_types/freshwater_lamp/images/lps.png"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\src\\device_types\\freshwater_lamp\\images\\lps.png",
        "relativePath": "images/adaptive/large/src/device_types/freshwater_lamp/images/lps.png"
      }
    ]
  },
  "src\\device_types\\freshwater_lamp\\images\\lps.webp": {
    "original": "src\\device_types\\freshwater_lamp\\images\\lps.webp",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\src\\device_types\\freshwater_lamp\\images\\lps.webp",
        "relativePath": "images/adaptive/small/src/device_types/freshwater_lamp/images/lps.webp"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\src\\device_types\\freshwater_lamp\\images\\lps.webp",
        "relativePath": "images/adaptive/medium/src/device_types/freshwater_lamp/images/lps.webp"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\src\\device_types\\freshwater_lamp\\images\\lps.webp",
        "relativePath": "images/adaptive/large/src/device_types/freshwater_lamp/images/lps.webp"
      }
    ]
  },
  "src\\device_types\\freshwater_lamp\\images\\MasterDDSSlicePNG68893369b20403a9f5f6b109de8c7f66.png": {
    "original": "src\\device_types\\freshwater_lamp\\images\\MasterDDSSlicePNG68893369b20403a9f5f6b109de8c7f66.png",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\src\\device_types\\freshwater_lamp\\images\\MasterDDSSlicePNG68893369b20403a9f5f6b109de8c7f66.png",
        "relativePath": "images/adaptive/small/src/device_types/freshwater_lamp/images/MasterDDSSlicePNG68893369b20403a9f5f6b109de8c7f66.png"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\src\\device_types\\freshwater_lamp\\images\\MasterDDSSlicePNG68893369b20403a9f5f6b109de8c7f66.png",
        "relativePath": "images/adaptive/medium/src/device_types/freshwater_lamp/images/MasterDDSSlicePNG68893369b20403a9f5f6b109de8c7f66.png"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\src\\device_types\\freshwater_lamp\\images\\MasterDDSSlicePNG68893369b20403a9f5f6b109de8c7f66.png",
        "relativePath": "images/adaptive/large/src/device_types/freshwater_lamp/images/MasterDDSSlicePNG68893369b20403a9f5f6b109de8c7f66.png"
      }
    ]
  },
  "src\\device_types\\freshwater_lamp\\images\\MasterDDSSlicePNG7e20f89478c997508b9a79b3f287e999.png": {
    "original": "src\\device_types\\freshwater_lamp\\images\\MasterDDSSlicePNG7e20f89478c997508b9a79b3f287e999.png",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\src\\device_types\\freshwater_lamp\\images\\MasterDDSSlicePNG7e20f89478c997508b9a79b3f287e999.png",
        "relativePath": "images/adaptive/small/src/device_types/freshwater_lamp/images/MasterDDSSlicePNG7e20f89478c997508b9a79b3f287e999.png"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\src\\device_types\\freshwater_lamp\\images\\MasterDDSSlicePNG7e20f89478c997508b9a79b3f287e999.png",
        "relativePath": "images/adaptive/medium/src/device_types/freshwater_lamp/images/MasterDDSSlicePNG7e20f89478c997508b9a79b3f287e999.png"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\src\\device_types\\freshwater_lamp\\images\\MasterDDSSlicePNG7e20f89478c997508b9a79b3f287e999.png",
        "relativePath": "images/adaptive/large/src/device_types/freshwater_lamp/images/MasterDDSSlicePNG7e20f89478c997508b9a79b3f287e999.png"
      }
    ]
  },
  "src\\device_types\\freshwater_lamp\\images\\MasterDDSSlicePNGe44eaeee006ca36cf1ba3b0f1aced988.png": {
    "original": "src\\device_types\\freshwater_lamp\\images\\MasterDDSSlicePNGe44eaeee006ca36cf1ba3b0f1aced988.png",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\src\\device_types\\freshwater_lamp\\images\\MasterDDSSlicePNGe44eaeee006ca36cf1ba3b0f1aced988.png",
        "relativePath": "images/adaptive/small/src/device_types/freshwater_lamp/images/MasterDDSSlicePNGe44eaeee006ca36cf1ba3b0f1aced988.png"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\src\\device_types\\freshwater_lamp\\images\\MasterDDSSlicePNGe44eaeee006ca36cf1ba3b0f1aced988.png",
        "relativePath": "images/adaptive/medium/src/device_types/freshwater_lamp/images/MasterDDSSlicePNGe44eaeee006ca36cf1ba3b0f1aced988.png"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\src\\device_types\\freshwater_lamp\\images\\MasterDDSSlicePNGe44eaeee006ca36cf1ba3b0f1aced988.png",
        "relativePath": "images/adaptive/large/src/device_types/freshwater_lamp/images/MasterDDSSlicePNGe44eaeee006ca36cf1ba3b0f1aced988.png"
      }
    ]
  },
  "src\\device_types\\freshwater_lamp\\images\\slps.png": {
    "original": "src\\device_types\\freshwater_lamp\\images\\slps.png",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\src\\device_types\\freshwater_lamp\\images\\slps.png",
        "relativePath": "images/adaptive/small/src/device_types/freshwater_lamp/images/slps.png"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\src\\device_types\\freshwater_lamp\\images\\slps.png",
        "relativePath": "images/adaptive/medium/src/device_types/freshwater_lamp/images/slps.png"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\src\\device_types\\freshwater_lamp\\images\\slps.png",
        "relativePath": "images/adaptive/large/src/device_types/freshwater_lamp/images/slps.png"
      }
    ]
  },
  "src\\device_types\\freshwater_lamp\\images\\slps.webp": {
    "original": "src\\device_types\\freshwater_lamp\\images\\slps.webp",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\src\\device_types\\freshwater_lamp\\images\\slps.webp",
        "relativePath": "images/adaptive/small/src/device_types/freshwater_lamp/images/slps.webp"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\src\\device_types\\freshwater_lamp\\images\\slps.webp",
        "relativePath": "images/adaptive/medium/src/device_types/freshwater_lamp/images/slps.webp"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\src\\device_types\\freshwater_lamp\\images\\slps.webp",
        "relativePath": "images/adaptive/large/src/device_types/freshwater_lamp/images/slps.webp"
      }
    ]
  },
  "src\\device_types\\freshwater_lamp\\images\\sps.png": {
    "original": "src\\device_types\\freshwater_lamp\\images\\sps.png",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\src\\device_types\\freshwater_lamp\\images\\sps.png",
        "relativePath": "images/adaptive/small/src/device_types/freshwater_lamp/images/sps.png"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\src\\device_types\\freshwater_lamp\\images\\sps.png",
        "relativePath": "images/adaptive/medium/src/device_types/freshwater_lamp/images/sps.png"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\src\\device_types\\freshwater_lamp\\images\\sps.png",
        "relativePath": "images/adaptive/large/src/device_types/freshwater_lamp/images/sps.png"
      }
    ]
  },
  "src\\device_types\\freshwater_lamp\\images\\sps.webp": {
    "original": "src\\device_types\\freshwater_lamp\\images\\sps.webp",
    "sizes": [
      {
        "name": "small",
        "width": 360,
        "path": "images\\adaptive\\small\\src\\device_types\\freshwater_lamp\\images\\sps.webp",
        "relativePath": "images/adaptive/small/src/device_types/freshwater_lamp/images/sps.webp"
      },
      {
        "name": "medium",
        "width": 720,
        "path": "images\\adaptive\\medium\\src\\device_types\\freshwater_lamp\\images\\sps.webp",
        "relativePath": "images/adaptive/medium/src/device_types/freshwater_lamp/images/sps.webp"
      },
      {
        "name": "large",
        "width": 1080,
        "path": "images\\adaptive\\large\\src\\device_types\\freshwater_lamp\\images\\sps.webp",
        "relativePath": "images/adaptive/large/src/device_types/freshwater_lamp/images/sps.webp"
      }
    ]
  }
},
  
  /**
   * 根据原始图片路径和屏幕宽度获取自适应图片路径。
   * 如果映射数据尚未加载或找不到对应图片，将返回原始路径。
   * @param {string} originalPath - 原始图片路径 (应使用 / 作为分隔符)
   * @param {number} screenWidth - 设备屏幕宽度 (通常是 windowWidth)
   * @returns {string} 适合当前设备的图片相对路径，或原始路径
   */
  getAdaptiveImagePath: function(originalPath, screenWidth) {
    if (!originalPath) return ''; // 处理空路径输入

    // 确保路径分隔符为 /
    const normalizedOriginalPath = String(originalPath).replace(/\\/g, '/');

    if (!imageData) {
      // console.warn(`[image_size_map] Image map data not yet available for '${normalizedOriginalPath}'. Returning original path.`);
      // 尝试再次触发加载，但不阻塞当前调用。
      // 如果应用设计允许稍微延迟显示正确图片，可以不在这里调用。
      if (!isLoading) { // 避免重复触发
        _internalEnsureDataLoaded().catch(()=>{/* no-op for non-blocking call */});
      }
      return normalizedOriginalPath;
    }

    const mapping = imageData[normalizedOriginalPath];
    
    if (!mapping || !mapping.sizes || mapping.sizes.length === 0) {
      // console.log(`[image_size_map] No mapping or sizes found for '${normalizedOriginalPath}'.`);
      return normalizedOriginalPath;
    }
    
    let selectedSizeName = 'large'; // 默认大图
    // 断点可以根据项目实际情况调整
    if (screenWidth <= 375) { // 例如 iPhone SE, iPhone 8
      selectedSizeName = 'small';
    } else if (screenWidth <= 768) { // 例如 iPad Mini 竖屏, 大多数手机横屏
      selectedSizeName = 'medium';
    }
    // 对于 > 768 的认为是 'large'

    const selectedImage = mapping.sizes.find(s => s.name === selectedSizeName);
    
    if (selectedImage && selectedImage.relativePath) {
      return selectedImage.relativePath;
    } else {
      // 如果找不到完全匹配的尺寸，可以考虑一个降级策略，例如返回原始路径或一个默认尺寸
      // console.warn(`[image_size_map] No suitable size '${selectedSizeName}' found for '${normalizedOriginalPath}'. Returning original.`);
      return normalizedOriginalPath; // 当前行为：返回原始路径
    }
  },

  /**
   * 返回一个 Promise，在图片映射数据加载完成后 resolve。
   * 可用于需要确保数据加载完毕后再执行操作的场景。
   */
  ensureDataReady: function() {
    // 如果已经加载，或正在加载中，返回对应的 Promise
    if (imageData || isLoading) {
      return loadPromise || Promise.resolve(imageData); // loadPromise 可能是 null 如果 imageData 已存在
    }
    // 如果还没开始加载，则开始加载
    return _internalEnsureDataLoaded();
  },

  /**
   * 检查数据是否已加载完毕 (同步检查)
   * @returns {boolean}
   */
  isDataLoaded: function() {
    return !!imageData && Object.keys(imageData).length > 0; // 确保imageData不是初始的空对象
  }
};